home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / win-fort.zip / RESIZE.FOR < prev    next >
Text File  |  1991-11-09  |  2KB  |  56 lines

  1. $DEFINE GDI
  2. $DEFINE USER
  3. $DEFINE WINMESSAGES
  4.       INCLUDE 'WINDOWS.FI'
  5.       SUBROUTINE RESIZE(hWnd2,NEWSIZE,SIZE)
  6.       IMPLICIT NONE
  7. C
  8. C Author       : Kevin B Black
  9. C Date written : 23-Oct-1991
  10. C Abstract     :
  11. C
  12. C HANDLE RESIZING OF CLOCK WINDOW
  13. C
  14. C Subroutine to handle things that need to be dealt with when the window
  15. C is resized, before windows paints the paint message
  16. C
  17.       INTEGER*2 hWnd2,NEWSIZE(2),SIZE
  18.  
  19.       LOGICAL L
  20.       INCLUDE 'WINDOWS.FD'           ! Include windows functions and parameters
  21.       INCLUDE 'FWCLOCK.FD'           ! Include FWclocks functions and parameters
  22. C
  23. C Set new clock size and tell Windows to post a repaint message
  24. C
  25.       RCLOCK.LEFT=0
  26.       RCLOCK.TOP=0
  27.       WWIDTH=NEWSIZE(1)
  28.       RCLOCK.RIGHT=WWIDTH
  29.       WHEIGHT=NEWSIZE(2)
  30.       RCLOCK.BOTTOM=WHEIGHT
  31. C
  32. C Kill current time and restart at an interval appropriate to whether the
  33. C window is open (every quater of a second) or iconic (once a second) when
  34. C FWClock changes between the two states.
  35. C
  36.       L=SIZE.EQ.SIZEICONIC
  37.       IF(IMANICON.XOR.L)THEN
  38.          WSTATUS=KillTimer(hWnd2,MYTIMER)
  39.          IF(IMANICON)THEN ! This is .NOT. the real state of affairs
  40.             WSTATUS=SetTimer(hWnd,MYTIMER,200,0)
  41.          ELSE
  42.             WSTATUS=SetTimer(hWnd,MYTIMER,1000,0)
  43.          ENDIF
  44.          IF(WSTATUS.EQ.0)THEN
  45.             CALL FatalAppExit(0,'FWClock: Failed to restart timer'C)
  46.             STOP
  47.          ENDIF
  48.          IMANICON=.NOT.IMANICON 
  49.       ENDIF
  50. C
  51. C Cause windows to repaint the window
  52. C
  53.       CALL UpdateWindow(hWnd2)
  54.       RETURN
  55.       END
  56.